Skip to content

Add behavioral subfeature data guideline #26781

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ddbeck
Copy link
Contributor

@ddbeck ddbeck commented May 13, 2025

Summary

This PR provides a general guideline for creating behavioral subfeatures.

Related issues

This continues a discussion started in #26605 (comment), while #26780 covers the partial implementation part of this.

This was partly inspired by #17352, but is narrower in scope.

@github-actions github-actions bot added docs Issues or pull requests regarding the documentation of this project. size:s [PR only] 7-24 LoC changed labels May 13, 2025
Copy link
Contributor

github-actions bot commented May 13, 2025

Tip: Review these changes grouped by change (recommended for most PRs), or grouped by feature (for large PRs).

Copy link
Contributor

@caugner caugner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM so far.

Like #26780 already includes, some more examples might help comprehension.

@ddbeck
Copy link
Contributor Author

ddbeck commented May 14, 2025

@caugner I already mentioned 3 examples (css.properties.gap.flex_context and css.properties.gap.grid_context, and html.global_attributes.inert.ignores_find_in_page) and mention more specific guidelines (e.g., secure_context_required). Do you have something in mind here?

Comment on lines 175 to 177
- A contextual support condition this is not readily feature detectable, such as a CSS layout context or the effect of [an IDL extended attribute](https://dontcallmedom.github.io/webidlpedia/extended-attributes.html).

For example, if support for a CSS property is conditioned on the layout context where that property is used, create a subfeature of the property to represent the behavior (as demonstrated by `css.properties.gap.flex_context` and `css.properties.gap.grid_context`).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's what I had in mind:

Suggested change
- A contextual support condition this is not readily feature detectable, such as a CSS layout context or the effect of [an IDL extended attribute](https://dontcallmedom.github.io/webidlpedia/extended-attributes.html).
For example, if support for a CSS property is conditioned on the layout context where that property is used, create a subfeature of the property to represent the behavior (as demonstrated by `css.properties.gap.flex_context` and `css.properties.gap.grid_context`).
- When support depends on a contextual condition that cannot be easily or accurately feature-detected.
Examples:
1. CSS layout context: The CSS property `gap` depends on the layout context, so there are behavioral subfeatures `flex_context` and `grid_context` to distinguish support (see: [css/properties/gap.json](https://github.com/mdn/browser-compat-data/blob/main/css/properties/gap.json)).
2. Effects of [an IDL extended attribute](https://dontcallmedom.github.io/webidlpedia/extended-attributes.html) <!-- Add example -->

Same for the behavioral evolution.

@ddbeck ddbeck requested a review from caugner May 15, 2025 11:11
@github-actions github-actions bot added size:m [PR only] 25-100 LoC changed and removed size:s [PR only] 7-24 LoC changed labels May 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Issues or pull requests regarding the documentation of this project. size:m [PR only] 25-100 LoC changed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants